{% extends 'layout.html' %}
{% load my_tags %}
{% block content %}
{# <a href="{% reverse_url request 'courseForm' class_id %}">添加课程信息</a>#}
    <form action="" method="post" class="form-inline">
        {% csrf_token %}

        <select name="action" id="" class="form-control">
            <option value="multi_init">批量添加学习记录</option>
        </select>
        <button class="btn btn-info">提交</button>


        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <th>选择</th>
                <th>序号</th>
                <th>班级名称</th>
                <th>课程标题</th>
                <th>是否有作业</th>
                <th>作业标题</th>
                <th>讲师</th>
                <th>记录者</th>
                <th>日期</th>
                <th>操作</th>

            </tr>
            </thead>
            <tbody>
            {% for course in course_all %}
                <tr>
                    <td><input type="checkbox" name="customer_pk" value="{{ course.id }}"></td>
                    <td>{{ forloop.counter }}</td>
                    <td>{{ course }}</td>
                    <td>{{ course.course_title }}</td>
                    <td>{% if course.has_homework %}
                    是{% else %}否
                    {% endif %}</td>
                    <td>{{ course.homework_title }}</td>
                    <td>{{ course.teacher }}</td>
                    <td>{{ course.recorder }}</td>
                    <td>{{ course.date }}</td>
                          <td>
                    <a href="{% reverse_url request 'courserecord_edit' course.id %}">
                        <button type="button" class="btn-primary btn btn-sm">编辑</button>
                                         </a>
                      <a href="{% reverse_url request 'studyrecord' course.id %}">
                        <button type="button" class="btn-success btn btn-sm ">查看学习记录</button>
                           </a>
                           </td>


            {% endfor %}

            </tbody>
        </table>
        <div style="margin-left: 40%">
            <ul class="pagination"> {{ page_html }}</ul>
        </div>

    </form>

{% endblock %}
